package com.example.order_engine.domain.event;

import com.example.order_engine.domain.model.Order;
import org.springframework.context.ApplicationEvent;

import java.time.Clock;

/**
 * 订单创建领域事件
 */
public class OrderCreatedEvent extends ApplicationEvent {
    
    private final Order order;
    
    public OrderCreatedEvent(Object source, Order order) {
        super(source);
        this.order = order;
    }
    
    public OrderCreatedEvent(Object source, Clock clock, Order order) {
        super(source, clock);
        this.order = order;
    }
    
    public Order getOrder() {
        return order;
    }
}